package com.bm.jarquickstart.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 港某
 * @datetime 2021/4/27 9:15
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class LayuiR<T> {

    private int code;
    private int count;
    private String msg;
    private T data;

    public static <T> LayuiR<T> data(T data) {
        return new LayuiR<>(200, 0, "成功", data);
    }

    public static <T> LayuiR<T> page(int count, T data) {
        return new LayuiR<>(0, count, "成功", data);
    }

}
